"use strict";
const common_vendor = require("../../common/vendor.js");
const storage = {
  set(key, value) {
    if (key != null && value != null)
      common_vendor.index.setStorageSync(key, value);
  },
  get(key) {
    if (!localStorage)
      return null;
    if (key == null)
      return null;
    return common_vendor.index.getStorageSync(key);
  },
  setJSON(key, jsonValue) {
    if (jsonValue != null)
      this.set(key, JSON.stringify(jsonValue));
  },
  getJSON(key) {
    const value = this.get(key);
    if (value != null)
      return JSON.parse(value);
  },
  remove(key) {
    common_vendor.index.removeStorageSync(key);
  }
};
exports.storage = storage;
